package com.qf.controller;

import com.qf.pojo.resp.BaseResp;
import com.qf.service.DrugService;
import com.qf.service.FruitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/drug")
@Api(tags = "药品类特有的接口")
public class DrugController {
    @Autowired
    DrugService drugService;

    //通过活动找到店铺,以及商品等详细信息
    @ApiOperation("满减优惠等活动等,传入string 类型字符串(String类型的freeName),该接口只适用于药品类")
    @PostMapping("/findByFree")
    public BaseResp findByFree(String freeName){
        System.out.println(freeName);
        return  drugService.findByFree(freeName);
    }

    @ApiOperation("传入药品的三级分类的字符串(String类型的three),该接口只适用于药品类")
    //通过三级分类先找 商品分类,再找 商品
    @PostMapping("/findThree")
    public BaseResp findThree(String three){

        return  drugService.findThree(three);
    }
}
